home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / cbm / 5786 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: f411.n201!not-for-mail
  2. Newsgroups: comp.sys.cbm
  3. X-Comment-To: Stephen Judd
  4. From: Pontus Berg <Pontus.Berg@p71.anet.canit.se>
  5. Date: Wed, 17 Apr 96 22:30:29 +0200
  6. Subject: programming question:block-X commands
  7. Message-ID: <829805336@p71.f411.n201.z2.ftn>
  8. References: <1617696615@news.acns.nwu.edu>
  9. Organization: BoArDgasm, Farsta, Sweden
  10. X-FTN-AREA: CANIT_COMP_SYS_CBM
  11. X-FTN-MSGID: 2:201/411.71 3175d318
  12. X-FTN-REPLY: news.acns.nwu.edu 606c1767
  13. X-FTN-CHRS: IBMPC 2
  14. X-FTN-Tearline: Spot 1.3a #676
  15. X-FTN-Origin: BoArDgasm, Farsta, Sweden (2:201/411.71)
  16. X-FTN-SEEN-BY: 201/411 
  17. X-FTN-PATH: 201/411 
  18. X-FTN-PATH: 201/411
  19.  
  20. In a message of 16 Apr 96 Stephen Judd wrote to All:
  21.  
  22.  >> hexprt  pha
  23.  >>        asl
  24.  >>        asl
  25.  >>        asl
  26.  >>        asl
  27.  
  28.  SJ> Better make those lsr
  29.  
  30. Right!
  31.  
  32.  >>        jsr hexout
  33.  >>        pla
  34.  >> hexout  and #$0f
  35.  
  36.  SJ> And hexout can be moved here, to the tax -- gotta save those cycles!
  37.  SJ> :).
  38.  
  39. Right! Two wasted cycles! I better kill myself over this :-D
  40.  
  41.  >>        tax
  42.  >>        lda hextab,x
  43.  >>        jmp $ffd2
  44.  
  45.  SJ> And of course you might want an rts here :)
  46.  
  47. NOPE, I DON'T! A JMP alway include the RTS in the end of the called routine so
  48. you suggestion would cause more "wear and tear" on the stack, 12 extra cycles
  49. and also one byte longer! You'll better go for the PC next :-)
  50.  
  51.  >> hextab  .text "0123456789abcdef"
  52.  
  53.  SJ> If you want screen codes, you might use
  54.  
  55.  SJ> HEXOUT
  56.  SJ>  CLC
  57.  SJ>  ADC #48
  58.  SJ>  CMP #58
  59.  SJ>  BCC :L1
  60.  SJ>  SBC #57
  61.  SJ> :L1 STA wherever, say (zp),y plus an INY
  62.  SJ>  RTS
  63.  
  64. ... which also saves four bytes :-)
  65.  
  66. )==========================================================(
  67. )  o/    Bacchus@FairLight.COM  Fido: 2:201/411.71         (
  68. ) (#  I'm a "geek tool" so ask about emulators elsewhere!  (
  69. )=/7=======================================================(
  70.  
  71. ... MicroSoft, as good as AIDS!
  72.     (Pontus)
  73.